<%- include header %>

<div class="menu">
    <span>home</span>
    <span>|</span>
    <span><a href="#">javascript</a></span>
    <span>php</span>
    <span>pathon</span>
    <span>java</span>
    <span>mysql</span>
    <span>ios</span>
    <span>android</span>
    <span>node.js</span>
    <span>html5</span>
    <span>lunux</span>
    <span>c++</span>
    <span>...</span>
</div>
<div style="width:1024px;margin:1em auto;">
    <div style="border:1px solid green;width:720px;float:left">
        <ul class="horul">
            <li>最新</li>
            <li>最热</li>
            <li>未回答</li>
        </ul>
        <table class="table">
            <tbody class="answer">
            <% if(question.length!=0){question.forEach(function (row) { %>
            <tr>
                <td>
                    <div><%= row["renum"] %><br/>回答</div>
                </td>
                <td><%= row["looknum"] %><br/>浏览</td>
                <td name="<%= row["qid"] %>" onclick="content(this)" style="cursor: pointer"><%= row["title"] %></td>
            </tr>
            <% })  %>
            <tr>
                <td colspan="3" align="center">当前页码：<%= page["page"] %> &nbsp;
                    <% if(page["page"] != 1){ %>
                    <a href="/?page=1">首页</a>
                    <a href="/?page=<%= parseInt(page["page"]) - 1 %>">上一页</a>
                    <% } if(page["maxPage"] != page["page"]){ %>
                    <a href="/?page=<%= parseInt(page["page"]) + 1 %>">下一页</a>
                    <a href="/?page=<%= page["maxPage"] %>">尾页</a>
                    <% } %>
                </td>
            </tr><% }%>
            </tbody>

        </table>
    </div>
    <div style="border:1px solid green;width:300px;float:right">
        <table class="table">
            <caption>排行榜</caption>
            <tbody>
            <tr>
                <td>1</td>
                <td>Bangalore</td>
            </tr>
            <tr>
                <td>2</td>
                <td>Mumbai</td>
            </tr>
            <tr>
                <td>3</td>
                <td>Bangalore</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<div class="modal fade" id="loginModal" style="width: 950px">
    <div class="modal-dialog">
        <div class="modal-content" style="width: 950px">
            <!--------href内容----------------->

            <!--------------------------------->
        </div>
    </div>
</div>
<script type="text/javascript">
    function content(that) {
        let qid = $(that).attr("name")
        window.location.href = "/question/count?qid="+qid
    }
</script>
</body>
</html>